package net.huashitong.ssydt.provider.exam.service;


import net.huashitong.ssydt.exam.entity.SsExamPaperRecord;

/**
 * @author <a href="mailto:yhy23456@163.com">huiyang.yu</a>
 * @since 2017.09.04
 */
public interface SsExamPaperRecordService {

    SsExamPaperRecord getNotHistoryByUserIdAndPaperId(String userId, Long paperId);

    void updateByPrimaryKey(SsExamPaperRecord ssExamPaperRecord);

    void insert(SsExamPaperRecord ssExamPaperRecord);

    SsExamPaperRecord getById(Long id);

    /**
     * 统计某个试卷的已交卷数
     *
     * @param paperId
     * @return
     */
    int countSubmittedByPaperId(Long paperId);

    /**
     * 统计某个试卷的小于等于的correctNumber已交卷数
     *
     * @param paperId
     * @param correctNumber
     * @return
     */
    int countSubmittedByPaperIdWithLessOrEqualsCorrectNumber(Long paperId, Integer correctNumber);
}
